package seven.entity;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class InfoBean implements Writable{
	private int orderId;
	private String dataString;
	private String pId;
	private int amount;
	private String pname;
	private int categoryId;
	private float price;
	private String flag;
	public InfoBean(){}
	
	
	
	
	
	
	public void set(int orderId,String dataString,String pId,int amount,String pname,
			int categoryId,float price,String flag){
		this.orderId = orderId;
		this.dataString = dataString;
		this.pId = pId;
		this.amount = amount;
		this.pname = pname;
		this.categoryId = categoryId;
		this.price = price;
		this.flag = flag; 
	}
	public int getOrderId() {
		return orderId;
	}
	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}
	public String getDataString() {
		return dataString;
	}
	public void setDataString(String dataString) {
		this.dataString = dataString;
	}
	public String getpId() {
		return pId;
	}
	public void setpId(String pId) {
		this.pId = pId;
	}
	public int getAmount() {
		return amount;
	}
	public void setAmount(int amount) {
		this.amount = amount;
	}
	public String getPname() {
		return pname;
	}
	public void setPname(String pname) {
		this.pname = pname;
	}
	public int getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}






	@Override
	public void readFields(DataInput in) throws IOException {
		this.orderId = in.readInt();
		this.dataString = in.readUTF();
		this.pId  = in.readUTF();
		this.amount = in.readInt();
		this.pname = in.readUTF();
		this.categoryId = in.readInt();
		this.price = in.readFloat();
		this.flag = in.readUTF();
	}






	@Override
	public void write(DataOutput out) throws IOException {
		out.writeInt(this.orderId);
		out.writeUTF(this.dataString);
		out.writeUTF(this.pId);
		out.writeInt(this.amount);
		out.writeUTF(this.pname);
		out.writeInt(this.categoryId);
		out.writeFloat(this.price);
		out.writeUTF(this.flag); 
	}
	@Override
	public String toString(){
		return "orderId="+orderId+",dataString="+dataString+",pId="+pId+",amount="+
				amount+",pname="+pname+",categoryId="+categoryId+",price="+price+",flag="+flag;
	}
	
}
